package framework.beans;

/**
 * wrapper of the bean instance
 */
public class InchBeanWrapper {
    //new instance of the bean (proxy)
    private Object wrappedInstance;
    //original class
    private Object originClass;

    /**
     * Constructor with a instance that need to be wrapped
     * @param instance instance that need to be wrapped
     */
    public InchBeanWrapper(Object instance){
        this.originClass = instance;
        //wrap the instance
        wrap(instance);
    }

    /**
     * wrap method if there are more decoration add in this method
     * @param instance origin instance
     * @return wrapped instance
     */
    private void wrap(Object instance) {
        this.wrappedInstance = instance;
    }

    public Object getWrappedInstance() {
        return wrappedInstance;
    }

    public Object getOriginClass() {
        return originClass;
    }
}
